Computer implemented method and system for sharing resources among hierarchical containers of resources

ABSTRACT

Computer implemented method, system and computer usable program code for sharing resources among a plurality of containers in a data processing system. A computer implemented method includes creating a shared container for at least one resource to be shared. Then the at least one resource to be shared is moved from an original container of the at least one resource to the shared container, and a link is created between the original container and the at least one resource to be shared in the shared resource container. A link can also be created between a subject resource container and a shared resource in the shared resource container to enable the subject resource container to access and use the shared resource. A shared resource can also be removed from the shared resource container and returned to an original resource container when sharing of the resource is no longer desired.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to the data processing field and, more particularly, to a computer implemented method, system and computer usable program code for sharing resources among a plurality of hierarchically arranged containers of resources in a data processing system.

2. Description of the Related Art

Many Integrated Development Environments (IDEs) such as Eclipse, JBuilder® and Virtual Studio®, help software developers manage the source code of their applications using an artifact referred to as a “project.” A project defines a compilation unit in which source files are stored and can be built to produce an executable program.

In the case of multi-tiered applications, the source code is usually distributed among several projects, with each project being dedicated to a specific tier. A typical example is a client-server application, where one project is used to implement client components and another project is used to implement server components. Each tier is part of the same system and it frequently occurs that one or more components, a messaging API (Application Program Interface) for example, need to be replicated and used in several tiers of the application. Consequently, the source files of these components have to be shared among several projects.

Several approaches are currently available for managing source files that are shared among a plurality of projects. One approach is to give the developer the responsibility of maintaining multiple copies of the files in different projects. This approach, however, requires substantial effort from the developer who has to manually handle the file creations/deletions and keep the copies in sync.

Another approach is to declare a reference to an external project, and include the content of the referenced project in the local compiler path. This is the standard mechanism for sharing components among several projects using the features provided by an IDE. This approach, however, has several drawbacks including the following:

-   -   Coarse granularity: Only complete projects can be shared. The         developer cannot share finer grain components.     -   Hidden sharing: The sharing operation is hidden behind obscure         properties so that the developer has no visibility on the shared         components.

It would, accordingly, be desirable to provide an improved mechanism for sharing resources among a plurality of containers of resources in a data processing system.

SUMMARY OF THE INVENTION

Exemplary embodiments provide a computer implemented method, system and computer usable program code for sharing resources among a plurality of containers of resources in a data processing system. A computer implemented method for sharing resources among a plurality of containers of resources in a data processing system includes creating a shared container for at least one resource to be shared. Then the at least one resource to be shared is moved from an original container of the at least one resource to the shared container, and a link is created between the original container and the at least one resource to be shared in the shared resource container. A link can also be created from a subject resource container to a shared resource in the shared resource container to enable the subject resource container to access and use the shared resource. A shared resource can also be removed from the shared resource container and returned to an original resource container when sharing of the resource is no longer desired.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the exemplary embodiments are set forth in the appended claims. The exemplary embodiments themselves, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:

FIG. 1 depicts a pictorial representation of a network of data processing systems in which exemplary embodiments may be implemented;

FIG. 2 is a block diagram of a data processing system in which exemplary embodiments may be implemented;

FIG. 3 is a block diagram that schematically illustrates a system for sharing resources among hierarchical containers of resources according to an exemplary embodiment;

FIG. 4 is a block diagram that schematically illustrates a system for sharing resources among hierarchical projects in an Eclipse integrated development environment according to an exemplary embodiment;

FIG. 5 illustrates a project structure for an Order Entry example software application in the system of FIG. 4 according to an exemplary embodiment;

FIG. 6 is a flowchart that illustrates a method for a “share resource” operation according to an exemplary embodiment;

FIG. 7 is a flowchart that illustrates a method for an “use shared resource” operation according to an exemplary embodiment; and

FIG. 8 is a flowchart that illustrates a method for an “unshare resource” operation according to an exemplary embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

With reference now to the figures and in particular with reference to FIGS. 1-2, exemplary diagrams of data processing environments are provided in which exemplary embodiments may be implemented. It should be appreciated that FIGS. 1-2 are only exemplary and are not intended to assert or imply any limitation with regard to the environments in which different embodiments may be implemented. Many modifications to the depicted environments may be made.

With reference now to the figures, FIG. 1 depicts a pictorial representation of a network of data processing systems in which exemplary embodiments may be implemented. Network data processing system 100 is a network of computers in which embodiments may be implemented. Network data processing system 100 contains network 102, which is the medium used to provide communications links between various devices and computers connected together within network data processing system 100. Network 102 may include connections, such as wire, wireless communication links, or fiber optic cables.

In the depicted example, server 104 and server 106 connect to network 102 along with storage unit 108. In addition, clients 110, 112, and 114 connect to network 102. These clients 110, 112, and 114 may be, for example, personal computers or network computers. In the depicted example, server 104 provides data, such as boot files, operating system images, and applications to clients 110, 112, and 114. Clients 110, 112, and 114 are clients to server 104 in this example. Network data processing system 100 may include additional servers, clients, and other devices not shown.

In the depicted example, network data processing system 100 is the Internet with network 102 representing a worldwide collection of networks and gateways that use the Transmission Control Protocol/Internet Protocol (TCP/IP) suite of protocols to communicate with one another. At the heart of the Internet is a backbone of high-speed data communication lines between major nodes or host computers, consisting of thousands of commercial, governmental, educational and other computer systems that route data and messages. Of course, network data processing system 100 also may be implemented as a number of different types of networks, such as for example, an intranet, a local area network (LAN), or a wide area network (WAN). FIG. 1 is intended as an example, and not as an architectural limitation for different embodiments.

With reference now to FIG. 2, a block diagram of a data processing system is shown in which exemplary embodiments may be implemented. Data processing system 200 is an example of a computer, such as server 104 or client 110 in FIG. 1, in which computer usable code or instructions implementing the processes may be located for the exemplary embodiments.

In the depicted example, data processing system 200 employs a hub architecture including a north bridge and memory controller hub (MCH) 202 and a south bridge and input/output (I/O) controller hub (ICH) 204. Processor 206, main memory 208, and graphics processor 210 are coupled to north bridge and memory controller hub 202. Graphics processor 210 may be coupled to the MCH through an accelerated graphics port (AGP), for example.

In the depicted example, local area network (LAN) adapter 212 is coupled to south bridge and I/O controller hub 204 and audio adapter 216, keyboard and mouse adapter 220, modem 222, read only memory (ROM) 224, universal serial bus (USB) ports and other communications ports 232, and PCI/PCIe devices 234 are coupled to south bridge and I/O controller hub 204 through bus 238, and hard disk drive (HDD) 226 and CD-ROM drive 230 are coupled to south bridge and I/O controller hub 204 through bus 240. PCI/PCIe devices may include, for example, Ethernet adapters, add-in cards, and PC cards for notebook computers. PCI uses a card bus controller, while PCIe does not. ROM 224 may be, for example, a flash binary input/output system (BIOS). Hard disk drive 226 and-CD-ROM drive 230 may use, for example, an integrated drive electronics (IDE) or serial advanced technology attachment (SATA) interface. A super I/O (SIO) device 236 may be coupled to south bridge and I/O controller hub 204.

An operating system runs on processor 206 and coordinates and provides control of various components within data processing system 200 in FIG. 2. The operating system may be a commercially available operating system such as Microsoft® Windows® XP (Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both). An object oriented programming system, such as the Java™ programming system, may run in conjunction with the operating system and provides calls to the operating system from Java programs or applications executing on data processing system 200 (Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both).

Instructions for the operating system, the object-oriented programming system, and applications or programs are located on storage devices, such as hard disk drive 226, and may be loaded into main memory 208 for execution by processor 206. The processes of the illustrative embodiments may be performed by processor 206 using computer implemented instructions, which may be located in a memory such as, for example, main memory 208, read only memory 224, or in one or more peripheral devices.

The hardware in FIGS. 1-2 may vary depending on the implementation. Other internal hardware or peripheral devices, such as flash memory, equivalent non-volatile memory, or optical disk drives and the like, may be used in addition to or in place of the hardware depicted in FIGS. 1-2. Also, the processes of the illustrative embodiments may be applied to a multiprocessor data processing system.

In some illustrative examples, data processing system 200 may be a personal digital assistant (PDA), which is generally configured with flash memory to provide non-volatile memory for storing operating system files and/or user-generated data. A bus system may be comprised of one or more buses, such as a system bus, an I/O bus and a PCI bus. Of course the bus system may be implemented using any type of communications fabric or architecture that provides for a transfer of data between different components or devices attached to the fabric or architecture. A communications unit may include one or more devices used to transmit and receive data, such as a modem or a network adapter. A memory may be, for example, main memory 208 or a cache such as found in north bridge and memory controller hub 202. A processing unit may include one or more processors or CPUs. The depicted examples in FIGS. 1-2 and above-described examples are not meant to imply architectural limitations. For example, data processing system 200 also may be a tablet computer, laptop computer, or telephone device in addition to taking the form of a PDA.

Exemplary embodiments provide a computer implemented method, system and computer usable program code for sharing resources among a plurality of hierarchically arranged containers of resources in a data processing system.

FIG. 3 is a block diagram that schematically illustrates a system for sharing resources among hierarchical containers of resources according to an exemplary embodiment. The system is generally designated by reference number 300, and comprises a plurality of resource containers 302, 304 and 306 containing resources. As shown in FIG. 3, resource container 302 contains resource A, resource container 304 contains resource B, and resource container 306 contains resources C and D. This is intended to be exemplary only as system 300 can contain any number of resource containers, and each resource container can contain any number of resources.

A resource can, for example, be a folder or file that contains source code. A container can, for example, be a project that contains folders and files, i.e. that contains resources. A container can also be a composite project that contains other projects, including other composite projects.

System 300 also includes shared resource container 308. Shared resource container 308 contains resources S, T and U that have been moved from their original containers to shared resource container 308 so that the resources may be shared among resource containers 302, 304 and 306 in system 300. In particular, by moving resources S, T and U to shared resource container 308, they can be linked to and accessed by one or more of resource containers 302, 304 and 306. Thus, in the exemplary embodiment illustrated in FIG. 3, resource container 302 has been linked to and can access and use resources S and T via links 310 and 312, respectively, resource container 304 has been linked to and can access and use resource S via link 314, and resource container 306 has been linked to and can access and use resource T via link 316. Resources A, B, C and D, on the other hand, are unshared resources and cannot be accessed by other than the resource containers in which they are contained.

FIG. 4 is a block diagram that schematically illustrates a system for sharing resources among hierarchical projects in an Eclipse integrated development environment according to an exemplary embodiment. In particular, FIG. 4 is an exemplary implementation of system 300 illustrated in FIG. 3, and utilizes corresponding reference numbers to refer to corresponding components.

As shown in FIG. 4, Eclipse composite project 400 includes Eclipse projects 402, 404 and 406; and Eclipse shared project 408. Eclipse project 402 contains folder A and is linked to and can access and use folders S and T in Eclipse shared project 408 via links 410 and 412, respectively. Eclipse project 404 contains folder B and is linked to and can access and use folder S in Eclipse shared project 408 via link 414. Eclipse project 406 contains folders C and D and is linked to and can access and use folder T in Eclipse shared project 408 via link 416.

FIG. 5 illustrates a project structure 500 for an Order Entry example software application in the system of FIG. 4 according to an exemplary embodiment.

According to exemplary embodiments, three operations for managing shared resources (e.g., source files) among a plurality of containers of resources (e.g., projects) are provided. These include a “share resource” operation, an “use shared resource” operation and an “unshare resource” operation.

FIG. 6 is a flowchart that illustrates a method for a “share resource” operation according to an exemplary embodiment. The method is generally designated by reference number 600, and begins by moving a resource to be shared from an original resource container in which the resource is located to a shared resource container (Step 602). A link is then created from the original resource container to the shared resource in the shared resource container (Step 604), and the method ends.

FIG. 7 is a flowchart that illustrates a method for an “use shared resource” operation according to an exemplary embodiment. The method is generally designated by reference number 700, and begins by creating a link from a subject resource container that wishes to access and use a shared resource to the resource in the shared resource container (Step 702). The shared resource is then accessed and used as needed by the subject resource container (Step 704), and the method ends.

FIG. 8 is a flowchart that illustrates a method for an “unshare resource” operation according to an exemplary embodiment. The method is generally designated by reference number 800, and begins by obtaining a list of resource containers having links to a shared resource to be “unshared” (Step 802). A determination is made whether there are any more resource containers on the list with links to the shared resource (Step 804). If there is a resource container with a link to the shared resource (Yes output of Step 804), the link is removed from that container, i.e., the current container, (Step 806), and the shared resource is copied from the shared resource container to the current container (Step 808). The method then returns to Step 804 to determine if there are any more resource containers with links to the shared container. If there are no more resource containers with links to the shared container (No output of Step 804), the resource is removed from the shared resource container (Step 810), and the method ends.

Exemplary embodiments rely on a multi-tiered project structure, where all projects of a given application are referenced by metadata. When a multi-tiered project is created, the metadata is initialized and a project dedicated to the management of the shared components is created as well. The shared components of the application will be stored in this project, which is accessible and editable at any time by the developer.

Consider an application implemented as three projects: project D, project S and the shared components project. Project D defines a component C that the developer wants to reuse in project S. The “share component” operation is implemented by moving component C from its original location (D) to the shared components project, and then creating a symbolic link to C in project D. The “use shared component” operation is implemented by creating a symbolic link in project S pointing to the shared component C. Both operations are performed using information stored in the metadata of the project (such as the location of the shared component project). Consequently, a project needs to be known as part of the system (and referenced in the metadata) in order for the project to use the sharing features.

A history of the sharing operations in a given application is stored in the metadata. Accessing this history allows system tooling to undo/redo these operations, which supports the “unshare component” feature.

The following scenario illustrates a typical use of the three operations in a method for managing resources in a data processing system:

-   -   A developer implements a messaging API in a project that holds         the client code of its application. The developer wants to         leverage this API to implement the server components of the         application that will handle the client requests.     -   The developer enables the sharing of the “messaging API”         resources.     -   The developer accesses the list of resources available for         sharing, and then selects the messaging API resources to be used         in the server project. Although this resource was first defined         in the client project, it is now used in both the client and the         server projects.

The exemplary embodiments provide for sharing of resources at a fine grain. A developer is able to select precisely the resources that he/she wants to share inside a project. These resources will then be accessible from other projects.

When the sharing features are enabled, the developer is able to work in different projects with multiple links to the same resource. The resource is visible as a first-class object in each project, and it is possible to access and edit the resource using standard tooling, the same as if it were a regular resource. Changes to a shared resource from any container are immediately visible to all other containers that link to that resource.

These sharing features facilitate development of applications intended to run on multiple computing platforms, such as different mobile devices. Since each shared object appears as a first-class resource in each project that uses the object, the compilation of a shared resource can be customized to the particular platform to which each project is targeted. For example, the same shared resource can be compiled against Java™ 2 Standard Edition (J2SE) libraries when compiled as part of a project targeted to one class of mobile device, and compiled against Java™ 2 Micro Edition (J2ME) libraries when compiled as part of another project targeted to a different class of mobile device.

As indicated above, support is also provided for unsharing previously shared resources. As sharing a resource changes the state of the source and target projects, it is necessary to rollback these modifications if the developer wants to cancel a sharing operation. Using the “unshare resource” operation, the projects can be restored to their initial state.

Exemplary embodiments thus provide a computer implemented method, system and computer usable program code for sharing resources among a plurality of containers of resources in a data processing system. A computer implemented method for sharing resources among a plurality of containers of resources in a data processing system includes creating a shared container for at least one resource to be shared. Then the at least one resource to be shared is moved from an original container of the at least one resource to the shared container, and a link is created between the original container and the at least one resource to be shared in the shared resource container. A link can also be created from a subject resource container to a shared resource in the shared resource container to enable the subject resource container to access and use the shared resource. A shared resource can also be removed from the shared resource container and returned to an original resource container when sharing of the resource is no longer desired.

The invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.

Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any tangible apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.

A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.

Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.

Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.

The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated. 

1. A computer implemented method for sharing source code files among a plurality of project containers in a data processing system, the computer implemented method comprising: creating a shared project container for at least one source code file to be shared among the plurality of project containers, wherein a project container defines a compilation unit in which source code files are stored and built to produce an executable multi-tiered application, and wherein the source code files for the multi-tiered application are distributed among the plurality of project containers with each project container being dedicated to a specific tier in the multi-tied application, and wherein at least one of the plurality of project containers includes a composite project that contains other projects; moving each at least one source code file to be shared from an original project container to the shared project container; creating a link between each original project container and each at least one source code file to be shared in the shared project container; creating a link between a subject project container and a target shared source code file of the at least one source code file to be shared in the shared project container to enable the subject project container to access the target shared source code file in the shared project container, wherein the subject project container accesses and uses the target shared source code file in the shared project container; customizing processing of the target shared source code file for the subject project container such that the target shared source code file is processed differently for the subject project container than for others of a plurality of subject project containers that are linked to the target shared source code file, wherein the target shared source code file includes shared source code, and wherein the plurality of subject project containers include a plurality of programming projects, and wherein customizing processing of the target shared source code file for the subject project container includes customizing compilation and linking of the shared source code differently for each of a plurality of computing platforms in which each programming project that links to the shared source code is intended to run; and unsharing a source code file to be shared in the shared project container, wherein unsharing a source code file to be shared in the shared project container includes removing the link between a subject project container and the shared source code file to be unshared in the shared project container, copying the shared source code file to be unshared from the shared project container to the subject project container, and removing the shared source code file to be unshared from the shared project container. 